﻿<%@ Page Title="" Language="C#" MasterPageFile="~/PortalParts/Portal.Master" AutoEventWireup="true" CodeBehind="PartyScore.aspx.cs" Inherits="ZHDJ.Web.Portal.PartyScore" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script src="../Resource/js/jquery/jquery.pagination.js"></script>
    <link href="../Resource/themes/default/css/party.score.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        .starOP {
        color:red; cursor:pointer;
        }
        .starDiv {
        word-wrap: break-word;  
        word-break: normal;  
        }
    </style>
    <script type="text/javascript">
        var pageSize = 10;
        $(function () {
            initBranchPage();
            initMemberPage();

            //组织查询
            $("#btnBranchQuery").click(function () {
                initBranchPage();
            });
            //党员查询
            $("#btnMemberQuery").click(function () {
                initMemberPage();
            });

            $("#txtBranchName").keypress(function (event) {
                if (event.keyCode == 13) {
                    $("#btnBranchQuery").click();
                    return false;
                }
            });

            $("#txtUserName").keypress(function (event) {
                if (event.keyCode == 13) {
                    $("#btnMemberQuery").click();
                    return false;
                }
            });
        });

        //初始化组织分页
        function initBranchPage() {
            $("#branch_score_order .score-list-tr").remove();
            $("#branch_page").hide();
            $.get("PartyScore.aspx", {
                CountType: "Branch",
                Keyword: $("#txtBranchName").val(),
                r: (new Date()).getTime()
            }, function (data) {
                $("#branch_page").pagination(data, {
                    num_edge_entries: 1, //边缘页数
                    num_display_entries: 4, //主体页数
                    callback: branchCallback,
                    items_per_page: pageSize, //每页显示1项
                    prev_text: "上一页",
                    next_text: "下一页"
                });
                if (data == 0) {
                    $("#branch_page").hide();
                }
                else {
                    $("#branch_page").show();
                }
            });
        }

        //初始化党员分页
        function initMemberPage() {
            $("#member_score_order .score-list-tr").remove();
            $("#member_page").hide();
            $.get("PartyScore.aspx", {
                CountType: "Member",
                Keyword: $("#txtUserName").val(),
                r: (new Date()).getTime()
            }, function (data) {
                $("#member_page").pagination(data, {
                    num_edge_entries: 1, //边缘页数
                    num_display_entries: 4, //主体页数
                    callback: memberCallback,
                    items_per_page: pageSize, //每页显示1项
                    prev_text: "上一页",
                    next_text: "下一页"
                });

                if (data == 0) {
                    $("#member_page").hide();
                }
                else {
                    $("#member_page").show();
                }
            });
        }

        function branchCallback(pageIndex, jq) {
            $.get("PartyScore.aspx", {
                ScoreType: 'Branch',
                Keyword: $("#txtBranchName").val(),
                PageIndex: pageIndex,
                PageSize: pageSize,
                r: (new Date()).getTime()
            },
                function (data) {
                    $("#branch_score_order .score-list-tr").remove();
                    if (data == null || data == "") {
                        data = "<tr class=\"score-list-tr\"><td align='center' colspan='4'>此栏目暂无信息</td></tr>";
                    }
                    var $content = $(data);
                    $("#branch_score_order").append($content);
                }, 'text');
            return false;
        }

        function memberCallback(pageIndex, jq) {
            $.get("PartyScore.aspx/WriteMemberScoreList", {
                ScoreType: 'Member',
                Keyword: $("#txtUserName").val(),
                PageIndex: pageIndex,
                PageSize: pageSize,
                r: (new Date()).getTime()
            },
                function (data) {
                    $("#member_score_order .score-list-tr").remove();
                    if (data == null || data == "") {
                        data = "<tr class=\"score-list-tr\"><td align='center' colspan='5'>此栏目暂无信息</td></tr>";
                    }
                    var $content = $(data);
                    $("#member_score_order").append($content);
                }, 'text');
            return false;
        }

        function StarOp(id, flag) {
            if (flag == 'all') {
                $("#all" + id).show();
                $("#" + id).hide();
            } else {
                $("#" + id).show();
                $("#all" + id).hide();
            }
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="portal-page-content s_content_k s_content_border">
        <div class="party-score-left-area">
            <div class="party-score-left-area-top"></div>
            <div class="party-score-left-area-middle">
                <!--登陆-->
                <div class="party-score-left-content" runat="server" id="divUserInfo">
                    <table border="0" cellpadding="2" cellspacing="0" width="100%">
                        <tr>
                            <td colspan="2" valign="middle" align="center">
                                <asp:Image ID="imgPhoto" runat="server" Style="width: 140px; height: 140px; margin-bottom: 10px;" />
                            </td>
                        </tr>
						<tr>
							<td style="width: 42px;">姓名：</td>
							<td>
                                <asp:Label ID="lbUserName" runat="server"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td>星级：</td>
                            <td>
                                <asp:Label ID="lbClass" runat="server"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td>积分：</td>
                            <td>
                                <asp:Label ID="lbScore" runat="server"></asp:Label>
                            </td>
                        </tr>
                    </table>
                </div>


                <!--每日之星-->
                <div class="party-score-left-content">
                    <div class="party-scroe-today-star-title"></div>
                    <table border="0" cellpadding="2" cellspacing="0" width="100%">
                        <tr>
                            <td colspan="2" style="width: 140px; height: 140px;" valign="middle" align="center">
                                <asp:Image ID="imgStarPhoto" runat="server" Style="width: 140px; height: 140px; margin-bottom: 10px;" />
                            </td>
                        </tr>
						<tr>
							<td style="width: 42px;">姓名：</td>
                            <td>
                                <asp:Label ID="lbStarUserName" runat="server"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td>星级：</td>
                            <td>
                                <asp:Label ID="lbStarClass" runat="server"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td>积分：</td>
                            <td>
                                <asp:Label ID="lbStarScore" runat="server"></asp:Label>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
            <div class="party-score-left-area-bottom"></div>
        </div>
        <div class="party-score-right-area">
            <!--组织积分排行-->
            <div class="party-socre-right-content">
                <div class="party-socre-right-branch-title">
					<strong>党组</strong><span>查看比学排行榜</span>
                    <input id="txtBranchName" type="text" class="party-score-query-text" />
                    <input id="btnBranchQuery" type="button" value="搜索" class="party-score-query-button" />
                </div>
                <div class="party-score-grid-area" style="height: auto">
                    <table border="0" cellpadding="0" cellspacing="0" width="100%" class="party-score-grid-table" id="branch_score_order">
                        <tr>
                            <th style="width: 90px;">名次</th>
                            <th style="width: 250px;">组织名称</th>
                            <th style="width: auto;">星级</th>
                            <th style="width: 110px;">积分</th>
                        </tr>
                    </table>
                    <asp:HiddenField ID="hfBranchCount" runat="server" />
                    <div id="branch_page" class="pagination"></div>
                </div>
            </div>
            <div style="clear: both; font-size: 10px; height: 20px;"></div>
            <!--个人积分排行-->
            <div class="party-socre-right-content">
                <div class="party-socre-right-member-title">
					<strong>党组</strong><span>查看比学排行榜</span>
                    <input id="txtUserName" type="text" class="party-score-query-text" />
                    <input id="btnMemberQuery" type="button" value="搜索" class="party-score-query-button" />
                </div>
                <div class="party-score-grid-area" style="height: auto">
                    <table border="0" cellpadding="0" cellspacing="0" width="100%" class="party-score-grid-table" id="member_score_order">
                        <tr>
                            <th style="width: 90px;">名次</th>
                            <th style="width: 110px;">姓名</th>
                            <th style="width: 250px;">组织名称</th>
                            <th style="width: auto;">星级</th>
                            <th style="width: 110px;">积分</th>
                        </tr>
                    </table>
                    <asp:HiddenField ID="hfMemberCount" runat="server" />
                    <div id="member_page" class="pagination"></div>
                </div>
            </div>
        </div>

        <div style="clear: both;"></div>
    </div>
</asp:Content>
